package risk.control.project.api;


import jakarta.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import risk.control.project.framework.PostController;
import risk.control.project.service.CaptchaService;

import java.util.HashMap;


@RestController
@RequestMapping(value = "/main", produces = {"application/json;charset=UTF-8"})
public class MAIN_000_000_002 extends PostController {


    private final CaptchaService captchaService;

    //获取验证码接口
    public MAIN_000_000_002(CaptchaService captchaService) {
        this.captchaService = captchaService;
    }

    @PostMapping(value = "/000_000_002")
    public String doPost(HttpServletRequest request) {
        return handleRequest(request);
    }

    @Override
    protected String postRequest(HashMap<String, String> param) {
        HashMap<String, String> captcha = captchaService.getCaptcha();
        return generateSucceed(captcha);
    }
}
